package nba2kmodtool.util;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class CloneTool {
	public static void main(String[] args) {
		try {
			Process pro = Runtime.getRuntime().exec("Nba2k9ModTool.jar");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static Object deepClone(Object src) {
		Object newObject = null;
		try {
			ByteArrayOutputStream bo = new ByteArrayOutputStream();
			ObjectOutputStream oo = new ObjectOutputStream(bo);
			oo.writeObject(src);
			ByteArrayInputStream bi = new ByteArrayInputStream(bo.toByteArray());
			ObjectInputStream oi = new ObjectInputStream(bi);
			newObject = oi.readObject();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return newObject;
	}

	public static void serialFile(File file) throws IOException {

	}
}
